<?
require_once("../config/dbconn.php");require_once("../config/powercls.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" type="text/javascript" src="../calendar/WdatePicker.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	
}
td{
font-size:12px;
}
-->
</style>

<link href="images/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td width="935" height="29" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">会员查询</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
              <tr>
                <td align="center" class="left_bt2"><form name="form1" method="post" action="?action=query">
                  时间：
                      <label>
                  <input name="time1" type="text" id="time1" size="8" onClick="WdatePicker()">
                  </label>
-
<input name="time2" type="text" id="time2" size="8" onClick="WdatePicker()">
<label>
<input type="submit" name="Submit" value="查询">
                    </label>
                </form></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="30"><table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center" bgcolor="#f2f2f2" >开始时间</td>
                <td height="30" align="center" bgcolor="#f2f2f2" >结束时间</td>
				        <?
			foreach($hyrankary as $k1=>$v1){
  ?>
                <td align="center" bgcolor="#f2f2f2" ><?=$v1?></td>
				 <?
 }
  ?>
                </tr>
    
              <tr>
                <td align="center"><? if (trim($time1)!='') echo $time1;
				?></td>
                <td height="30" align="center"><? 
				if (trim($time2)!='') echo $time2;?></td>
				          <?
						 $allhynum=0;
			foreach($hyrankary as $k1=>$v1){
  ?>
                <td align="center"><?
				$sqlhy="select count(id) as c from {$db_prefix}users where state=1 and rank='$k1'";
				if (trim($time1)!='') $sqlhy.=" and datediff(from_unixtime(confirmtime),'$time1')>=0";
				if (trim($time2)!='') $sqlhy.=" and datediff(from_unixtime(confirmtime),'$time2')<=0";
				$rshy=$db->get_one($sqlhy);
				echo  intval($rshy['c']);
				$allhynum+=intval($rshy['c']);
				?></td>
				        <?
 }
  ?>
                </tr>
      
            </table></td>
          </tr>
          <tr>
            <td height="30">&nbsp;</td>
          </tr>
          <tr>
            <td height="30" align="center">共有<?=$allhynum?>个会员</td>
          </tr>
          <tr>
            <td height="30">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
</html>
